package com.whfc.fvs.enums;

/**
 * @Description: 视频监控设备云台操作
 * @author: qzexing
 * @version: 1.0
 * @date: 2020/5/25 17:02
 */
public enum FvsDevicePtzOption {

    UP(0, "上"),
    DOWN(1, "下"),
    LEFT(2, "左"),
    RIGHT(3, "右"),
    LEFT_UP(4, "左上"),
    LEFT_DOWN(5, "左下"),
    RIGHT_UP(6, "右上"),
    RIGHT_DOWN(7, "右下"),
    ZOOM(8, "放大"),
    ZOOM_OUT(9, "缩小"),
    NEAR_FOCUS(10, "近焦距"),
    FAR_FOCUS(11, "远焦距");

    private final Integer value;

    private final String desc;

    FvsDevicePtzOption(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static FvsDevicePtzOption parseValue(Integer value) {
        switch (value) {
            case 0:
                return UP;
            case 1:
                return DOWN;
            case 2:
                return LEFT;
            case 3:
                return RIGHT;
            case 4:
                return LEFT_UP;
            case 5:
                return LEFT_DOWN;
            case 6:
                return RIGHT_UP;
            case 7:
                return RIGHT_DOWN;
            case 8:
                return ZOOM;
            case 9:
                return ZOOM_OUT;
            case 10:
                return NEAR_FOCUS;
            case 11:
                return FAR_FOCUS;
            default:
                return null;
        }
    }

}
